<?php

class Form_BuildingForm extends Form_Custom_General {
 
    public function init() {
        
        $build_id = $this->createElement('hidden', 'build_id')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($build_id);

        $build_name = $this->createElement('text', 'build_name')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("build_required_name"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "class" => "span6", "placeholder" => $this->translateObj->translate("build_frm_name")));
        $this->addElement($build_name);

        $build_phone = $this->createElement('text', 'build_phone')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("build_required_phone"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60", "class" => "span6", "placeholder" => $this->translateObj->translate("build_frm_phone")));
        $this->addElement($build_phone);
     
        $site_id = $this->createElement('select', 'site_id')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array( "class" => "select2"))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("build_required_site"))));
        $this->addElement($site_id);

        $build_address = $this->createElement('textarea', 'build_address')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("build_required_address"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60", "cols" => "50", "rows" => "3", "class" => "span6", "placeholder" => $this->translateObj->translate("build_frm_address")));
        $this->addElement($build_address);

        $build_city = $this->createElement('text', 'build_city')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("build_required_city"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60", "class" => "span6", "placeholder" => $this->translateObj->translate("build_frm_city")));
        $this->addElement($build_city);


        $build_status = $this->createElement('select', 'build_status')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("build_required_status"))));
        $this->addElement($build_status);


        $submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_save"));
        $this->addElement($submit);


        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_reset"));
        $this->addElement($reset);
    }

}